package com.ladlee.parking.constant;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;
import lombok.Setter;

/**
 * 停车类型枚举
 */
public enum ParkingEnum {

    TEMPORARY(0, "临时"),
    MONTH(1, "月租"),
    YEAR(2, "年租");

    @Getter
    @Setter
    private Integer type;

    @Getter
    @Setter
    private String name;

    ParkingEnum(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public static Boolean validation(Integer type) {
        for (ParkingEnum value : ParkingEnum.values()) {
            if (ObjectUtil.equal(value.type, type)) {
                return true;
            }
        }
        return false;
    }
}
